package com.test;

public class Example20 {
    public static void main(String[] args) {
        printRectangle(3, 5);
        int area = getArea(3, 5);
        System.out.println("area:" + area);
    }

    //定义一个printRectangle方法
    public static void printRectangle(int height, int width) {
        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                System.out.print("* ");
            }
            System.out.println();
        }
        System.out.println();
    }

    //定义一个求矩形面级的方法
    public static int getArea(int x, int y) {
        return x * y;
    }
}
